package com.neuedu.javase.inner;

import java.util.Collections;
import java.util.Comparator;

/**
 * @auth 金山老师
 * title:   书籍代码
 * creatime: 2022-09-27 11:35
 * 描述 :
 */
public class Outer2 {
    private static String name;

    private void method(){

    }


    static class Inner2{
        String name;
        int age;

        public void m1(){
            System.out.println("内部类的2，方法");
        }
    }


    public static void main(String[] args) {
        System.out.println("outer");



//        Outer2.name

        //内部类的创建对象
        Inner2 inner = new Inner2();
        inner.m1();



        
        //局部内部类
        class Inner3{

        }

        Inner3 in3 = new Inner3();
        System.out.println("in3 = " + in3);

//        class MyCom implements Comparator<Integer> {
//
//
//            @Override
//            public int compare(Integer o1, Integer o2) {
//                return 0;
//            }
//        }
//        Collections.sort( null,new MyCom());



      
        //匿名内部类
        Collections.sort(null, new Comparator<Integer>() {

            @Override
            public int compare(Integer o1, Integer o2) {
                return 0;
            }
        });
        
        



    }



}
